package com.jrzh.mvc.controller.sys.ajax;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jrzh.framework.base.controller.BaseAjaxController;
import com.jrzh.mvc.constants.SysConstant;
import com.jrzh.mvc.search.sys.UserSearch;
import com.jrzh.mvc.service.sys.manage.SysServiceManage;
import com.jrzh.mvc.view.sys.UserView;

@Controller(UserController.LOCATION + "UserController")
@RequestMapping(UserController.LOCATION)
public class UserController extends BaseAjaxController{
	public static final String LOCATION = "/sys/ajax/user/";
	
	@Autowired
	SysServiceManage sysServiceManage;
	
	@RequestMapping(method = RequestMethod.POST, value = "list")
	@ResponseBody
	public List<UserView> list(UserSearch search){
		List<UserView> result = new ArrayList<UserView>();
		try {
			search.setEqStatus(SysConstant.USER_STATUS.NORMAL);
			result = sysServiceManage.userService.viewList(search);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	@Override
	protected void setData() {
		
	}
}
